package com.snd.myfirstpro.voice_scheduling_platform.service;

import com.snd.myfirstpro.voice_scheduling_platform.dao.RoomMapper;
import com.snd.myfirstpro.voice_scheduling_platform.entity.Room;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class RoomServiceImpl {
    @Autowired
    private RoomMapper roomMapper;

    /**
     * 新增分组
     * @param room
     */
    public void addRoom(Room room) {
        room.setCreateDate(new Date());
        roomMapper.insert(room);
    }

    /**
     * 获取所有分组
     * @return
     */
    public List<Room> getRoomList(){
        return roomMapper.selectAll();
    }
}
